package Day03;

public class Text1 {
    public static void main(String[] args) {
        //匿名的常见使用场景
        Swimming s1 = new Swimming() {
            @Override
            public void swim() {
                System.out.println("狗游泳得飞快");
            }
        };
        go(s1);
    }
    //设计一个方法，接收swimming接口的
    public static void go(Swimming s){
        System.out.println("开始--------");
        s.swim();
    }
}
//猫狗都要参加游泳比赛
interface Swimming{
    void swim();
}
